package io;

import java.io.Serializable;
import java.util.Arrays;

//学生类
public class Student implements Serializable {
    private  String name;
    private  int age;
    private  String gender;

    //当一个属性被关键字transient修饰后，当这个对象进行序列化时
    // 此属性值会被忽略不必要的属性值可以达到对象序列化瘦身的目的

    private  transient String[]otherInfo;



    public Student() {
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", otherInfo=" + Arrays.toString(otherInfo) +
                '}';
    }

    public Student(String name, int age, String gender, String[] otherInfo) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.otherInfo = otherInfo;



    }
}
